package com.tedu.boot11;

import com.tedu.boot11.entity.Emp;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
public class ParamController {


    @RequestMapping("/param1")
    @ResponseBody //通过返回值给客户端相应数据
    public String param1(HttpServletRequest request){
        String info = request.getParameter("info");
        return  "参数"+info;
    }


    @RequestMapping("/param2")
    @ResponseBody
    public String param2(String name,int age){
        return "名字"+name+"年龄"+age ;
    }

    @RequestMapping("/param3")
    @ResponseBody
    public String param3(Emp emp){
        return emp.toString();
    }

}
